package notepad;

public class Page 
{
	private String title = "";
	private String someText = "";
	
	Page(String title)
	{
		if(title == null)
		{
			System.out.println("Wrong title format!");
		}
		else
		{
			this.title = title;
		}
	}
	
	void addSomeText(final String addText)
	{
		if(addText != null)
		{
			this.someText = this.someText.concat(addText);
		}
		 else
		 {
			 System.out.println("Wrong text format!");
		 }
	 }
	
	
	
	 void deleteText()
	 {
		 this.someText = "";
	 }
	public void showPageInfo() 
	{
		System.out.println(title + "\n" + someText);
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj != null && obj instanceof Page)
		{
			return ((Page) obj).title.equals(this.title);
		}
		else
		{
			return false;
		}
		
	}
}
